﻿using System.Threading;

namespace DuplicateFileFinder.Infrastructure
{
    public class ThreadSynchronizer
    {
        private static AutoResetEvent syncher;

        static ThreadSynchronizer()
        {
            syncher = new AutoResetEvent(false);
        }

        public static void Ready()
        {
            syncher.Set();
        }

        public static void Wait(int timeout)
        {
            syncher.WaitOne(timeout);
        }
    }
}
